import request from '@/utils/request'

// https://api-hmzs.itheima.net/v1/park/enterprise

/**
 * 获取企业列表
 * @param {*} params
 * @returns
 */
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

// https://api-hmzs.itheima.net/v1/park/industry
/**
 * 获取企业所属行业列表
 * @returns
 */
export function getIndustryListAPI() {
  return request({
    url: '/park/industry',
    method: 'GET'
  })
}

//  https://api-hmzs.itheima.net/v1/park/enterprise
/**
 * 新增企业
 * @param {*} data
 * @returns
 */
export const createExterpriseAPI = (data) => {
  return request.post('/park/enterprise', data)
}
//  https://api-hmzs.itheima.net/v1/park/enterprise/{id}
/**
 * 查看企业信息
 * @param {*} id
 * @returns
 */
export const getExterpriseDetailAPI = (id) => {
  return request.get(`/park/enterprise/${id}`)
}

//  https://api-hmzs.itheima.net/v1/park/enterprise
/**
 * 编辑企业信息
 * @param {*} data
 * @returns
 */
export const editExterpriseAPI = (data) => {
  return request.put('/park/enterprise', data)
}

//  https://api-hmzs.itheima.net/v1/park/enterprise/{id}
/**
 * 删除企业
 * @param {*} id
 * @returns
 */
export const delExterpriseAPI = (id) => {
  return request.delete(`/park/enterprise/${id}`)
}
//  https://api-hmzs.itheima.net/v1/park/rent/building
/**
 * 查询可租赁楼宇
 * @returns
 */
export const getRentBuildingAPI = () => {
  return request.get('/park/rent/building')
}
//  https://api-hmzs.itheima.net/v1/park/enterprise/rent
/**
 * 添加租赁合同
 * @param {*} data
 * @returns
 */
export const createRentAPI = (data) => {
  return request.post('/park/enterprise/rent', data)
}
